#include <stdio.h>
#include <string.h>

struct student
{
    char name[20];//数组，有20个char成员
    int age;
};


//通过指针访问结构体数组
int main()
{
    struct student st[3] = {{"张三", 23}, {"李四", 22}, {"王五", 11}};
    struct student *p = st;
    p->age = 100;
    p++;
    p->age = 32;
    p--;


    int i;
    for(i = 0; i < 3; i++)
    {
        printf("p[%d].name = %s, p[%d].age = %d\n", i, p[i].name, i, p[i].age);
    }

    return 0;
}

